fix(notifications): stop toast replay across nav and page reload - #134
Merged
Conversation
ToastContainer's dedup state was component-local, so it reset on every mount. Since it only renders inside Header, which the router mounts for /dashboard but not /settings, navigating away and back unmounted and remounted it, replaying a toast for every notification still active in the store — most visibly a GitHub-status outage, which can sit unchanged in the store for hours. A hard page refresh reproduced the same symptom via a different path: it wipes the notification store itself, so the next poll's unchanged outage looks brand new again. Persist the last-toasted message per source to sessionStorage, checked before showing a toast and pruned once a source's notification clears from the store. sessionStorage survives both a same-tab remount and a refresh, so a single mechanism covers both triggers without touching notifyTransitions()'s existing unconditional-push behavior.
- Restarts a toast's auto-dismiss timer on message updates instead of leaving a stale one from the prior message, which could dismiss the toast early - Reintroduces a short (3s) per-source coalescing throttle for rapid bursts of textually-different messages (e.g. a ticking rate-limit retry countdown), distinct from the persisted exact-message dedup — with a trailing-edge re-check so a suppressed value that's never superseded still surfaces once the window elapses, even when errors.ts's own same-message no-op guard would otherwise leave it permanently stuck - Wraps sessionStorage read/write in try/catch matching the codebase's established pattern, and clears toast dedup state on logout via onAuthCleared
Settings > Replace Token previously left poll/notification/toast/ dashboard-cache state and repo/org/tracked-user/view preferences from the prior identity in place when swapping to a different GitHub account, since setAuthFromPat never routed through the onAuthCleared cleanup path a real logout uses. Detects a login change (case-insensitive) and performs a full reset — config, view state, IndexedDB cache, and every registered onAuthCleared callback — matching clearAuth()'s exact ordering, while leaving same-identity token rotation (e.g. refreshing an expired PAT) completely unaffected so preferences aren't lost on routine rotation.
wgordon17
force-pushed
the
fix/outage-toast-spam
branch
from
August 18, 2026 19:23
c126cb7 to
710b595
Compare
wgordon17
marked this pull request as ready for review
August 18, 2026 19:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary